/*
 * Copyright 2012 Marsrutai.lt
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package lt.marsrutai.mobile.android.model;

import lt.marsrutai.mobile.android.model.enums.TrackType;
import android.os.Parcel;
import android.os.Parcelable;

public class Track implements Parcelable {
    
    public static final Parcelable.Creator<Track> CREATOR = new Parcelable.Creator<Track>() {

        @Override
        public Track createFromParcel(Parcel source) {
            return new Track(source);
        }

        @Override
        public Track[] newArray(int size) {
            return new Track[size];
        }
    };

    private String id;
    private String name;
    private String scheduleId;
    private TrackType trackType;
    
    public Track() {
    }
    
    public Track(Parcel in) {
        id = in.readString();
        name = in.readString();
        scheduleId = in.readString();
        String string = in.readString();
        if (string != null) {
            trackType = TrackType.valueOf(string);
        }
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(name);
        dest.writeString(scheduleId);
        dest.writeString(trackType != null ? trackType.name() : null);
    }
    
    @Override
    public int describeContents() {
        return 0;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getScheduleId() {
        return scheduleId;
    }

    public void setScheduleId(String scheduleId) {
        this.scheduleId = scheduleId;
    }


    public TrackType getTrackType() {
        return trackType;
    }


    public void setTrackType(TrackType trackType) {
        this.trackType = trackType;
    }
}
